<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    var x = 3;
    var y = 4;
    var obj = {
        x: 1,
        y: 6,
        getX: function() {
            var x = 5;
            return function() {
                return this.x;
            }();
        },
        getY: function() {
            var y = 7;
            return this.y;
        }
    }
    console.log(obj.getX()) //? 往上找指向全局(匿名函数的this是指向全局对象的) 故3
    console.log(obj.getY()) //? getY是由obj调用的，所以其this指向的是obj对象 故6
</script>
</body>
</html>
